#include "PrecompiledHeader_Engineer.h"
#include "IBullet.h"

/*--------------------------------------------------------------------------*/

IBullet::IBullet(const glm::vec3& pos, const glm::vec3& dir, float radius, const Color& color)
{
	this->m_direction = dir;

	this->SetParent(CTree::getInstance()->GetRoot());
	this->SetPosition(pos);
	this->SetRadius(radius);
	this->SetAmbient(color);
	this->SetDiffuse(color);
	this->SetSpecular(color);
}

/*--------------------------------------------------------------------------*/

IBullet::~IBullet()
{

}

/*--------------------------------------------------------------------------*/

void IBullet::Update()
{
	glm::vec3 p = this->GetPosition() - (this->m_direction * CSdl::getInstance()->GetDeltaTime());

	WTerrain::getInstance()->GetHeight(p);
	p.z += 1.0f;

	this->SetPosition(p);
}

/*--------------------------------------------------------------------------*/
